<div id="content-title">Add Student Details</div>

<script id="demo" type="text/javascript">
$(document).ready(function() {
	// validate signup form on keyup and submit
	var validator = $("#student-form").validate({
		rules: {
		studentId: {
			required:true,
			number:true },
		studentName: "required",			
		},
		messages: {
			studentId:{
				required:"Enter Student Id",
				number:"Enter Numbers" }, 
			studentName: "Enter Student Name",			
		},
		// the errorPlacement has to take the table layout into account
		errorPlacement: function(error, element) {
			if ( element.is(":radio") )
				error.appendTo( element.parent().next().next() );
			else if ( element.is(":checkbox") )
				error.appendTo ( element.next() );
			else
				error.appendTo( element.parent().next() );
		},
		
		
		// set this class to error-labels to indicate valid fields
		success: function(label) {
			// set &nbsp; as text for IE
			label.html("&nbsp;").addClass("checked");
		}
	});
	


});
</script>

<div id="content-data">
<div class="web-form">
<form name="student-form" id="student-form" method="post"
	action="./system/addstudent.php">
<fieldset><legend class="left">Add Student</legend>
<table border="0" bordercolor="" width="" bgcolor="">

	<tbody>
		<tr>
			<td colspan="3"><?php if($_SESSION['log-err'])echo "<div class='log-err'>".$_SESSION['log-err']."</div>"; ?>
			<?php if($_SESSION['log-info'])echo "<div class='log-info'>".$_SESSION['log-info']."</div>"; ?>
			</td>
		</tr>

		<tr>
			<td class="left"><label class="web-form-label">Student Id :</label></td>
			<td class="right"><input type="text" name="studentId" id="studentId"
				class="web-form-field" /></td>
			<td class="left">
			<div id="studentId-log" class="log-err"></div>
			</td>
		</tr>
		<tr>
			<td class="left"><label class="web-form-label">Student Name:</label></td>
			<td class="right"><input type="text" name="studentName"
				id="studentName" class="web-form-field" /></td>
			<td class="left">
			<div id="studentName-log" class="log-err"></div>
			</td>
		</tr>
		<tr>
			<td></td>
			<td class="right">
			<button type="submit" class="web-form-button"><img
				src="./public/images/usersadd.png"><span>Submit</span></button>
			</td>
		</tr>
	</tbody>
</table>
</fieldset>
</form>
</div>
</div>
